package dungnt.vpoint.mathtest;

import android.app.Activity;
import android.app.Dialog;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;

public class LeaderBoardActivity extends Activity{

    TextView lblTitle, lblNameTest, lblYourScore, lblScore, lblSave, lblLevel, lblDescription, lblCurrentLevel;
    EditText txtYourName;
    private Typeface tp;
    private final int ptUnit = TypedValue.COMPLEX_UNIT_PT;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_leaderboard);
        
        Dialog leaderboard_dialog = new Dialog(this);
        leaderboard_dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        leaderboard_dialog.setContentView(R.layout.leaderboard_dialog);
        leaderboard_dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        
        //set title
        lblTitle = (TextView)leaderboard_dialog.findViewById(R.id.lblLeaderBoardTitle);
        tp = Typeface.createFromAsset(getAssets(), "MYRIADPRO-REGULAR.OTF");
        lblTitle.setTypeface(tp);
        lblTitle.setText("Leaderboard");
        //lblTitle.setTextSize(ptUnit,8.78f);
        //name test
        lblNameTest = (TextView)leaderboard_dialog.findViewById(R.id.lblNameTest);
        tp = Typeface.createFromAsset(getAssets(), "arial_regular.ttf");
        lblNameTest.setTypeface(tp);
        lblNameTest.setText("Math Test: Add Test Score"); // change name test here
        //lblNameTest.setTextSize(ptUnit, 7.5f);
        //you scored
        lblYourScore = (TextView)leaderboard_dialog.findViewById(R.id.lblYourScore);
        tp = Typeface.createFromAsset(getAssets(), "MYRIADPRO-REGULAR.OTF");
        lblYourScore.setTypeface(tp);
        lblYourScore.setText("You Scored:");
        //lblYourScore.setTextSize(ptUnit, 5.78f);
        //Score
        lblScore = (TextView)leaderboard_dialog.findViewById(R.id.lblScore);
        tp = Typeface.createFromAsset(getAssets(), "arial_rounded_mt_bold.ttf");
        lblScore.setTypeface(tp);
        lblScore.setText("12"); // change score here
        //lblScore.setTextSize(ptUnit, 19.5f);
        //Save
        lblSave = (TextView)leaderboard_dialog.findViewById(R.id.lblSave);
        tp = Typeface.createFromAsset(getAssets(), "arial_regular.ttf");
        lblSave.setTypeface(tp);
        lblSave.setText("Save score as guests");
        //lblSave.setTextSize(ptUnit, 6.83f);
        //Level
        lblLevel = (TextView)leaderboard_dialog.findViewById(R.id.lblLevel);
        tp = Typeface.createFromAsset(getAssets(), "arial_regular.ttf");
        lblLevel.setTypeface(tp);
        lblLevel.setText("Level:");
        //lblLevel.setTextSize(ptUnit, 6.83f);
        //Current level
        lblCurrentLevel = (TextView)leaderboard_dialog.findViewById(R.id.lblCurrentLevel);
        tp = Typeface.createFromAsset(getAssets(), "arial_regular.ttf");
        lblCurrentLevel.setTypeface(tp);
        lblCurrentLevel.setText("6");
        //lblCurrentLevel.setTextSize(ptUnit, 10f);
        //Save description
        lblDescription = (TextView)leaderboard_dialog.findViewById(R.id.lblDescription);
        tp = Typeface.createFromAsset(getAssets(), "arial_regular.ttf");
        lblDescription.setTypeface(tp);
        lblDescription.setText("Save score to your gamer profile");
        //lblDescription.setTextSize(ptUnit, 6.83f);
        //enter name
        txtYourName = (EditText)leaderboard_dialog.findViewById(R.id.txtYourName);
        txtYourName.setTextSize(ptUnit, 6.83f);
        
        leaderboard_dialog.show();
    }
    
}
